#ifndef GX_FR_EDITOR_STATE_H
#define GX_FR_EDITOR_STATE_H

#include "LibGL/GxUI.h"

using namespace GxLibBasic;

namespace FinalRendering
{
	namespace Editor
	{
		class View;
		class View3D;
		class ViewLeft;
		class ViewTop;
		class ViewFront;
		class BoxTweaker;

		using namespace GxRendering::UI;

		class State abstract : public Object
		{
		protected:
			bool MouseDragging;
			int ldPosX, ldPosY;
			int lPosX, lPosY;
		public:
			State();
			virtual void DrawState_3DView(View3D * view);
			virtual void DrawState_LeftView(ViewLeft* view);
			virtual void DrawState_TopView(ViewTop * view);
			virtual void DrawState_FrontView(ViewFront * view);

			virtual void MouseDown(View * view, UIMouseEventArgs & e);
			virtual void MouseUp(View * view, UIMouseEventArgs & e);
			virtual void MouseMove(View * view, UIMouseEventArgs & e);
			virtual void KeyDown(View * view, UIKeyEventArgs & e);

			virtual void UpdateSelection();

		protected:
			void UpdateMousePosition(int x, int y);
			
			void SnapToGrid(float gsize,vec3 &v);
		};
	}
}

#endif